﻿<%@ page contentType="text/html;charset=UTF-8" autoFlush="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> 
<script language="javascript">
function showUploadHeader(show){
	if(show){
		document.getElementById("imageUpload").style.display="";
	}else{
		document.getElementById("imageUpload").style.display="none";
	}
}
</script>
<span class="title1">用户信息</span>
<table class="its" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td width="14%" align="center">
		<table>
			<tr>
				<td align="center" colspan="2">
					<c:choose>
					<c:when test="${usero.headerImage == null}" >
					<img src="qa/images/header_default100.jpg" width="100" height="100">
					</c:when>
					<c:otherwise>
					<html:img page="header${usero.headerImage}" width="100" height="100"/>
					</c:otherwise>
					</c:choose>
				</td>
			</tr>
			<tr>
				<td align="center">
					<html:link href="javascript:showUploadHeader(true)">修改头像</html:link>
				</td>
				<td align="center">
					<html:link page="/user.mrqa?action=prechangeuserprofile">修改信息</html:link>
				</td>
			</tr>
		</table>
		</td>
		<td width="16%" align="center" height="100%">
		<table height="100%" border="0" cellpadding="0" cellspacing="0">
			<c:if test="${usero.isSuper}">
			<tr>
				<td align="right">我的职务：</td>
				<td align="left"><font color="blue">版主</font></td>
			</tr>
			</c:if>
			<c:if test="${usero.type == '1'}">
			<tr>
				<td align="right">我的职务：</td>
				<td align="left"><font color="green">管理员</font></td>
			</tr>
			</c:if>
			<tr>
				<td align="right">我的帖子：</td>
				<td align="left"><c:out value="${questionCount}" /></td>
			</tr>
			<tr>
				<td align="right">我的回复：</td>
				<td align="left"><c:out value="${answerCount}" /></td>
			</tr>
			<tr>
				<td align="right">我的资料：</td>
				<td align="left"><c:out value="${sfCount}" /></td>
			</tr>
			<tr>
				<td align="right">我的积分：</td>
				<td align="left"><c:out value="${usero.userMoney.totalMoney}" /></td>
			</tr>
		</table>
		</td>
		<td align="center" valign="middle"><img src="qa/images/user_center_sep.GIF"></td>
		<td align="center">
		<table height="100%" border="0" width="100%">
			<tr>
				<td width="14%" align="right">登录名：</td>
				<td width="41%"><c:out value="${usero.loginName}" /></td>
				<td align="right" width="15%">名称：</td>
				<td><c:out value="${usero.name}" /></td>
			</tr>
			<tr>
				<td width="14%" align="right">注册时间：</td>
				<td>
					<fmt:formatDate value="${usero.registerDate}" var="registerDate" type="both" pattern="yyyy-MM-dd HH:mm:ss" />
					<c:out value="${registerDate}" />
				</td>
				<td align="right">最后登陆：</td>
				<td>
					<fmt:formatDate value="${usero.lastLoginDate}" var="lastLoginDate" type="both" pattern="yyyy-MM-dd HH:mm:ss" />
					<c:out value="${lastLoginDate}" />
				</td>
			</tr>
			<tr>
				<td align="right">个人经验：</td>
				<td><c:out value="${usero.userScore.totalScore}" /></td>
				<td align="right">个人头衔：</td>
				<td><c:out value="${usero.userScore.title}" /></td>
			</tr>
			<tr>
				<td align="right">电子邮件：</td>
				<td>
					<c:out value="${usero.email}" />&nbsp;&nbsp;&nbsp; 
					<c:if test="${usero.isEmailPublic == false}">未</c:if>公开
				</td>
				<td align="right">联系电话：</td>
				<td><c:out value="${usero.mobile}" /></td>
			</tr>
			<tr>
				<td align="right">个人签名：</td>
				<td><c:out value="${usero.signature}" /></td>
				<td align="right"></td>
				<td></td>
			</tr>
			</table>
		</td>
	</tr>
	<tr style="display:none" id="imageUpload">
		<html:form action="/user" method="post" enctype="multipart/form-data">
		<html:hidden property="action" value="uploadHeader" />
		<html:hidden property="id" value="${usero.id}" />
		<td colspan="4">
			<html:file property="header" size="42"/> (图像大小不超过100K，建议尺寸100*100px，支持格式：JPG，GIF，PNG)
			<br>
			<html:submit value="确  定" />&nbsp;&nbsp;
			<html:button property="cancel" value="取  消" onclick="showUploadHeader(false)" />
		</td>
		</html:form>
	</tr>
</table>

